/*
 * PGN_Reader : A simple pgn reader for chess games.
 * Copyright (C) 2011 Laurent BERNABE
 * 
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU General Public License along with
 * this program. If not, see <http://www.gnu.org/licenses/>.
 */
package com.gmail.bernabe.laurent.java_swing.pgn_reader.processing;

import ictk.boardgame.AmbiguousMoveException;
import ictk.boardgame.IllegalMoveException;

import java.io.File;
import java.io.FileNotFoundException;

import com.gmail.bernabe.laurent.java_swing.pgn_reader.gui.BoardCell;

/**
 * A common interface in order to abstract the used chess library :
 * so that it can easily be changed. For that, just use the good subclass of this one.
 * @author laurent-bernabe
 *
 */
public interface ChessLibraryAdapter extends PlayingTape {

	/**
	 * Gets the piece value at given cell coordinates.
	 * @param cellCoords - BoardCell - cell coordinates (file and rank).
	 * @return ChessPiece - the chess piece instance from the used chess library.
	 */
	public abstract ChessPiece getPieceAt(BoardCell cellCoords);
	
	/**
	 * Loads data from a PGN file reference : all contained games should be stored
	 * in a collection. 
	 * @param pgnFile - File - the pgn file to load.
	 * @throws FileNotFoundException - if the file could not been found.
	 * @throws IllegalMoveException - if one move was illegal in a game.
	 * @throws AmbiguousMoveException - if one move was subject to several interpretations in a game.
	 */
	public abstract void loadPGN(File pgnFile) throws FileNotFoundException,
	 IllegalMoveException, AmbiguousMoveException;
	
	/**
	 * Load a game in the game collection (filled by loadPGN) by his index.
	 * If index is incorrect, it will try to load first game.
	 * @param gameIndexInCollection - int - index of game in collection.
	 */
	public abstract void loadGame(int gameIndexInCollection);
	
}
